#include <QLogger>

int main() {
  // Global init
  QLogger::init();

  QLogger logger("logger1");
  logger.info("Hello!");

  QLogger logger2("logger2", QLogger::Console);
  logger2.info("Hello! This message should only be"
               "shown in console.");

  // can set independent level for each logger
  logger2.setLevel(QLogger::Level::debug);
  logger2.debug("Debug info! This should be shown");
  logger.debug("Debug info! This shouldn't be shown");

  // can set global level for each mode
  QLogger::setModeLevel(QLogger::Level::info, QLogger::Console);
  logger2.debug("Debug info! This shouldn't be shown");
  // One message only is shown when the levels of
  // logger and sink are both higher than its level.
}